package cn.wolfcode.luowowo.website.controller;

import cn.wolfcode.luowowo.article.query.DestinationSearchCondition;
import cn.wolfcode.luowowo.article.query.DestinationSearchQueryObject;
import cn.wolfcode.luowowo.article.service.IDestinationSearchService;
import com.alibaba.dubbo.config.annotation.Reference;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("destinationSearch")
public class DestinationSearchController {

    @Reference
    private IDestinationSearchService destinationSearchService;

    @RequestMapping("/searchDestDetail")
    @ResponseBody
    public Object searchDest(Model model, @ModelAttribute("qo") DestinationSearchQueryObject qo) {
        PageInfo pageInfo = destinationSearchService.selectAll(qo);
//        model.addAttribute("pageInfo", pageInfo);
        return pageInfo;
    }
}
